//
// Created by 吴锐 on 2022/2/25.
//

#include "iostream"

using namespace std;

void MyPrint02(string test);

class MyPrint {
public:
    void operator()(string test) {
        cout << test << endl;
    }
};

void test01() {
    MyPrint myPrint;
    myPrint("hello world");

    MyPrint02("hello world");
}

void MyPrint02(string test) {
    cout << test << endl;
}

class MyAdd {
public:
    int operator()(int num1, int num2) {
        return num1 + num2;
    }
};

void test02() {
    MyAdd myAdd;
    int sum = myAdd(100, 100);
    cout << sum << endl;

    cout << MyAdd()(100, 100) << endl;
}

int main() {
//    test01();
    test02();
    return 0;
}